package com.kuaifawu.lwnlawyerclient.Adapter;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

import com.kuaifawu.lwnlawyerclient.Model.LWNModel_lawyerInfo;
import com.kuaifawu.lwnlawyerclient.R;

import java.util.List;

/**
 * Created by zhangminglei on 15/3/2.
 */
public class LWNAdapter_lawyerInfo extends ArrayAdapter {

    private LayoutInflater mInflater;
    private Context context_this;

    int head_count;
    int foot_count;

    public LWNAdapter_lawyerInfo(Context context, int resource, List objects) {
        super(context, resource, objects);
        context_this = context;
        this.mInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return 1;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.item_lawyerinfo, parent, false);
        }

//        TextView textView_biaoqian_one = (TextView) convertView.findViewById(R.id.li_sign_one);
//        TextView textView_biaoqian_two = (TextView) convertView.findViewById(R.id.li_sign_two);
//        TextView textView_biaoqian_three = (TextView) convertView.findViewById(R.id.li_sign_three);
        TextView textView_location = (TextView) convertView.findViewById(R.id.li_location);
        TextView textView_lingyu = (TextView) convertView.findViewById(R.id.li_lingyu);
        TextView textView_zhiye = (TextView) convertView.findViewById(R.id.li_zizhi);
        TextView textView_year = (TextView) convertView.findViewById(R.id.li_year);
        TextView textView_jiaoyu = (TextView) convertView.findViewById(R.id.li_jiaoyu);
        TextView textView_jigou = (TextView) convertView.findViewById(R.id.li_jigou);
        TextView textView_zhiwei = (TextView) convertView.findViewById(R.id.li_zhiwei);
        TextView textView_address = (TextView) convertView.findViewById(R.id.li_address);
        TextView textView_jianjie = (TextView) convertView.findViewById(R.id.li_jianli);

        LWNModel_lawyerInfo lawyerInfo = LWNModel_lawyerInfo.getInstance();
        String[] string_location = {"北京", "上海", "天津", "重庆", "黑龙江省", "吉林省", "辽宁省", "河北省", "山西省", "内蒙古", "山东省",
                "安徽省", "江苏省", "浙江省", "江西省", "福建省", "河南省", "湖北省", "湖南省", "广东省", "广西", "海南省", "四川省", "贵州省", "云南省", "西藏", "陕西省", "甘肃省", "青海省", "宁夏", "新疆",
                "香港", "澳门", "台湾省"};
        int kind_content = Integer.parseInt(lawyerInfo.getGoodatfield());
        String location = string_location[Integer.parseInt(lawyerInfo.getArea())];

        textView_location.setText(location);
//        textView_biaoqian_two.setText(lawyerInfo.getLife() + "年经验");
//        textView_biaoqian_three.setText(lawyerInfo.getPosition());
        textView_lingyu.setText(lawyerInfo.getShanchang());
        textView_zhiye.setText(lawyerInfo.getQualificati());
        textView_year.setText(lawyerInfo.getLife() + "年");
        textView_jiaoyu.setText(lawyerInfo.getEducation());
        textView_jigou.setText(lawyerInfo.getMechanism());
        textView_zhiwei.setText(lawyerInfo.getPosition());
        textView_address.setText(lawyerInfo.getOffice_address());
        textView_jianjie.setText(lawyerInfo.getIntro());

//        switch (kind_content) {
//            case 0: {
//                textView_biaoqian_one.setText("专长：婚姻家庭");
//            }
//            break;
//            case 1: {
//                textView_biaoqian_one.setText("专长：房屋买卖");
//            }
//            break;
//            case 2: {
//                textView_biaoqian_one.setText("专长：债务纠纷");
//            }
//            break;
//            case 3: {
//                textView_biaoqian_one.setText("专长：劳动争议");
//            }
//            break;
//            case 4: {
//                textView_biaoqian_one.setText("专长：交通肇事");
//            }
//            break;
//            case 5: {
//                textView_biaoqian_one.setText("专长：刑事案件");
//            }
//            break;
//            case 6: {
//                textView_biaoqian_one.setText("专长：其他类型");
//            }
//            break;
//            case 11: {
//                textView_biaoqian_one.setText("专长：公司注册");
//            }
//            break;
//            case 12: {
//                textView_biaoqian_one.setText("专长：投资融资");
//            }
//            break;
//            case 13: {
//                textView_biaoqian_one.setText("专长：股权期权");
//            }
//            break;
//            case 14: {
//                textView_biaoqian_one.setText("专长：合同事项");
//            }
//            break;
//            case 15: {
//                textView_biaoqian_one.setText("专长：知识产权");
//            }
//            break;
//            case 16: {
//                textView_biaoqian_one.setText("专长：财税事务");
//            }
//            break;
//            case 17: {
//                textView_biaoqian_one.setText("专长：劳动人事");
//            }
//            break;
//            case 18: {
//                textView_biaoqian_one.setText("专长：债务纠纷");
//            }
//            break;
//            case 19: {
//                textView_biaoqian_one.setText("专长：其他问题");
//            }
//            break;
//            default:
//                break;
//        }

        return convertView;
    }

}
